package com.dc.controller;

import com.dc.common.ResponseResultVO;
import com.dc.entity.ro.DeviceRO;
import com.dc.service.DeviceHistoryLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@Api(tags = "设备运行历史信息管理")
@RestController
@RequestMapping("/deviceLog")
@AllArgsConstructor
public class DeviceHistoryLongController {

    private final DeviceHistoryLogService deviceService;

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectDeviceByPage")
    public ResponseResultVO selectDeviceByPage(@RequestBody DeviceRO ro) {
        return deviceService.selectDeviceByPage(ro);
    }

    @ApiOperation(value = "列表导出", notes = "列表导出")
    @PostMapping("/deviceRecordExport")
    public void deviceRecordExport(HttpServletResponse response, @RequestBody DeviceRO ro) {
        deviceService.deviceRecordExport(response, ro);
    }
}
